package com.geek.novel.services

import android.content.res.Resources
import com.geek.novel.bo.AppContext
import com.geek.novel.entity.CrawlerSource
import com.geek.novel.utils.ToastUtils
import com.vicpin.krealmextensions.save

class CrawlerSourceService{
	
	private fun getResources(): Resources {
		return AppContext.getResources()
	}
	
	/**根据书本id获取章节*/
	fun saveList(list: List<CrawlerSource>?){
		if(list == null){
			ToastUtils.toast("保存的爬虫源不能为空！")
			return
		}
		for (crawlerSource in list) {
			crawlerSource.save()
		}
	}

}